<script lang="ts" setup>
import VueOfficePPTX from '@vue-office/pptx'

const { src } = defineProps({
  src: String,
})
const fileUrl = computed(() => {
  const config = useRuntimeConfig()
  const baseApi = config.public.baseApi

  return `/ppt/index.html?file=${baseApi}/file/forward?targetUrl=${decodeURIComponent(src)}`
})
</script>

<template>
  <div class="h-full w-full overflow-hidden">
    <iframe :src="fileUrl" frameborder="0" class="h-full min-h-800px w-full" />
    <!-- <VueOfficePPTX src="https://videodocument1.obs.cn-north-9.myhuaweicloud.com/hsprl%2F20241111182747312100.pptx" /> -->
    <!-- <VueOfficePPTX class="h-full w-full" :src="decodeURIComponent(src)" /> -->
  </div>
</template>

<style>
:deep(.vue-office-pptx-main) {
  height: 100%;
}
</style>
